package com.jxs.android.weiget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jxs.android.ges.R;

public class BuCommonTableView extends LinearLayout {

	private LinearLayout scroll_view_title, scroll_view_extends;
	private TextView null_has_data;

	public BuCommonTableView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public BuCommonTableView(Context context) {
		this(context, null);
		init(context);
	}

	private void init(Context context) {
		LayoutInflater.from(context).inflate(R.layout.bu_sales_table, this);
		setBackgroundResource(R.drawable.roundlist_single);
		scroll_view_extends = (LinearLayout) findViewById(R.id.scroll_view_extends);
		scroll_view_title = (LinearLayout) findViewById(R.id.scroll_view_title);
		null_has_data = (TextView) findViewById(R.id.null_has_data);
	}

	public void setEmpty(String text) {
		null_has_data.setText(text);
		null_has_data.setVisibility(View.VISIBLE);
	}

	public void setEmptyVisibility(int visibility) {
		null_has_data.setVisibility(visibility);
	}

	public void addContent(View buSalesItem) {
		scroll_view_extends.addView(buSalesItem);
	}

	public void addTitle(View buSalesItem) {
		scroll_view_title.removeAllViews();
		scroll_view_title.addView(buSalesItem);
	}

}
